<!DOCTYPE html>
<html>

	<head lang="en">
		<title>找攻略</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
		<script src="/js/jquery/jquery.min.js"></script>
		<script src="/js/bootstrap/js/bootstrap.min.js"></script>
		<link rel="stylesheet" href="/css/font/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/reset.css" />
		<link rel="stylesheet" href="/css/strategy.css" />
		<script src="/js/plugins/jrender/jrender.min.js"></script>
		<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css">
		<script src="/js/plugins/dialog2/dialog.min.js"></script>

		<script>
            $(function () {
                var keyword = sessionStorage.getItem("keyword");
                console.log(keyword);
                //搜索
				$.get("/strategies/travel", {keyword:keyword}, function (data) {
                    console.log(data);
                    $("#searchAll").renderValues({info:data.info,list:data.list},{
                        setHref:function (item, value) {
                            //重新设置href
                            $(item).attr("href",$(item).attr("href")+value)
                        }
					})
					//搜索框回显
					$("#searchBtn").val(keyword);
                })
            })
		</script>
	</head>

	<body>
	<div class="search-head">
		<div class="row nav-search">
			<div class="col-2">
				<a href="index.html">
					<span><i class="fa fa-chevron-left fa-2x"></i></span>
				</a>
			</div>
			<div class="col-10">
				<div class="input-group-sm search">
					<input id="searchBtn" class="form-control searchBtn" placeholder="找攻略">
				</div>
			</div>
		</div>
	</div>

	<ul class="nav nav-pills nav-justified border border-left-0 border-top-0 border-right-0" id="pills-tab" role="tablist">
		<li class="nav-item">
			<a class="nav-link active show" id="pills-top-tab" data-toggle="pill" href="#pills-top">
				<span style="font-weight: bold;">查询结果</span>
			</a>
		</li>

	</ul>
	<div id="searchAll">

		<div class="tab-content" id="pills-tabContent">
			<div class="tab-pane fade active show" id="pills-top">
				<div class="container strategyCommend">
					<h6>搜索攻略结果</h6>
					<div id="hotStrategy">
						<div class="row hot" render-loop="info">
							<div class="col-4">
								<a href="strategyCatalogs.html?strategyId=" render-fun="setHref" render-key="info.id">
									<img render-src="info.coverUrl">
									<p render-html="info.title"></p>
								</a>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

		<hr>

		<div class="container">
			<h6>搜索游记结果</h6>
			<div id="allTravels">
				<div render-loop="list">
					<div class="row detail">
						<div class="col">
							<a href="/travelContent.html?id="  render-fun="setHref" render-key="list.id">
								<h4 render-html="list.title"></h4>
							</a>
							<p>
								<a href="/userProfiles.html?id=" render-fun="setHref" render-key="list.author.id">
									<img class="rounded-circle head-img" render-src="list.author.headImgUrl">
									<span render-html="list.author.nickName"></span></a> 在
								<span class="addr" render-html="list.place.name"></span>

							</p>
							<p>
								<i class="fa fa-eye fa-fw"></i>
								<span>0</span>
								<i class="fa fa-commenting fa-fw"></i>
								<span>0</span>
							</p>
						</div>
						<div class="col bigimg">
							<a href="/travelContent.html?id=" render-fun="setHref" render-key="list.id">
								<img render-src="list.coverUrl">
							</a>
						</div>
					</div>
				</div>
			</div>
		</div>


	</div>
	</body>

</html>